<%@page import="com.caresms.service.Category_MasterLocalServiceUtil"%>
<%@page import="com.caresms.model.Category_Master"%>
<%@page import="com.liferay.portlet.expando.model.ExpandoValue"%>
<%@page
	import="com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil"%>

<%@page import="com.liferay.portal.model.User"%>

<%@page
	import="com.liferay.portlet.expando.service.ExpandoValueLocalServiceUtil"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@include file="/init.jsp"%>



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sms Category</title>
</head>
<body>
	<%
		if (isAdminUser && themeDisplay.isSignedIn()) {
	%>
	<portlet:actionURL name="catAction" var="catActionURL"></portlet:actionURL>
	<aui:form name="Sms_cat" id="Sms_cat"
		action='<%=catActionURL.toString()%>'>
		<aui:layout>
			<aui:column>

				<aui:input name="category" type="textbox" label="Sms Category"
					id="category">
					<aui:validator name="required" errorMessage="this field requred"></aui:validator>
					<aui:validator name="max">
'20'
</aui:validator>
					<aui:validator name="alphanum"></aui:validator>
				</aui:input>
				<aui:input name="isActive" label="Active" type="checkbox"
					checked="true">
				</aui:input>
			</aui:column>
		</aui:layout>
		<aui:button type="submit" value="ADD" cssClass="submitbtn"></aui:button>
	</aui:form>
	<%
		}
	%>
	<%
		List<Category_Master> list = Category_MasterLocalServiceUtil
				.getCategory_Masters(-1, -1);
		System.out.println("List size" + list.size());
	%>
	<portlet:renderURL var="viewURL" />

	<liferay-ui:search-container delta="10"
		emptyResultsMessage="No Results Found">
		<liferay-ui:search-container-results total="<%=list.size()%>"
			results="<%=list%>" />
		<liferay-ui:search-container-row modelVar="cat"
			className="com.caresms.model.impl.Category_MasterImpl">
			<liferay-ui:search-container-column-text name='Category Name' href="">
			<%=cat.getCatName() %>&nbsp;&nbsp;&#91;<%=cat.getCountsms() %>&#93;
			</liferay-ui:search-container-column-text>
			<%
				if (isAdminUser && themeDisplay.isSignedIn()) {
			%><liferay-ui:search-container-column-jsp
				path="/category/button.jsp" />
			<%
				}
			%>
		</liferay-ui:search-container-row>
		<liferay-ui:search-iterator searchContainer="<%=searchContainer%>"
			paginate="<%=true%>" />



	</liferay-ui:search-container>
</body>
</html>